POV-Ray : Newsgroups : povray.newusers : "include" file designs : "include" file designs Server Time
31 Jul 2024 02:18:38 EDT (-0400)
  "include" file designs  
From: Will W
Date: 20 Feb 2003 21:11:27
Message: <3e558acf@news.povray.org>
I've noticed that colors.inc will not reload if it finds evidence that it
has already been loaded (the following copied from colors.inc):

#ifdef(Colors_Inc_Temp)
     // do nothing
#else
     #declare Colors_Inc_Temp = someValue;
     // body of file is here
#end // last statement in file

However textures.inc doesn't use this approach while math.inc and shapes.inc
use slightly different logic with the #ifndef directive to do the same thing
(skip parsing the file if that has already been done once).

Am I correct in assuming that there are benefits in reduced overhead in
using this kind of approach in my own include files?

Also, would the following lines in myStuff.inc be worthwhile:

#ifdef(Colors_Inc_Temp)
    // do nothing, since colors.inc has already been called at least once
#else
    #include "colors.inc"
#end

I don't see anything like this in the standard includes I have looked at,
yet it looks like a simple extension of the idea (if POV isn't going to
parse the file anyway, why pay the even higher cost of loading it?)

--
Will Woodhull
Thornhenge, SW Oregon, USA
willl.at.thornhenge.net


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.